#!/bin/sh
#
# $FreeBSD$
#

# PROVIDE: ix-syncmultipaths
# REQUIRE: FILESYSTEMS ix-syncdisks

. /etc/rc.subr

syncmultipaths()
{
	echo "Syncing multipaths..."
	/usr/local/bin/midclt call disk.multipath_sync > /dev/null
	if [ "$(/usr/local/bin/midclt call system.is_enterprise)" = "True" ]; then
		checkyesno failover_enable || /usr/local/bin/midclt call enclosure.sync_zpool > /dev/null
	fi
}

name="ix-syncmultipaths"
start_cmd='syncmultipaths'
stop_cmd=''

load_rc_config $name
run_rc_command "$1"
